<!--conf
<sample>
              <product version="1.5" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Rowspan in Grid</title>
	
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
</head>

<body>
	<h1>Rowspan in Grid</h1>
	<p>There is an opportunity to set a rowspan in a grid.<br/> You can set it in the xml and by the script (using setRowspan method).<br/> 
	setRowspan method has 3 parameters:
	<ul>
	<li>row id</li>
	<li>column index</li>
	<li>rowspan</li>
	</ul>
	</p>
	
	<table width="600px">
		<tr>
			<td>
				<div id="gridbox" style="width:100%;height:270px;background-color:white;"></div>
			</td>
		</tr>
		<tr>
			<td>
		<input type="button" name="a1" value="row span (1)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),1)} else alert('Cell is not selected !')">
<input type="button" name="a1" value="row span (2)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),2)} else alert('Cell is not selected !')">
<input type="button" name="a1" value="row span (3)" onclick="if(mygrid.getSelectedId()){mygrid.setRowspan(mygrid.getSelectedId(),mygrid.getSelectedCellIndex(),3)} else alert('Cell is not selected !') ">

		</td></tr>
	</table>
	

<script>
	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../../codebase/imgs/");
	mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
	mygrid.setInitWidths("50,150,100,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("dyn,edtxt,ed,price,ch,co,ra,ro");
	mygrid.setColSorting("str,str,str,str,str,str,str,str")
	mygrid.init();
	mygrid.setSkin("dhx_skyblue");
	mygrid.enableRowspan(true)
	mygrid.loadXML("../common/grid_rowspan.xml",function(){
		mygrid.setRowspan(3,3,3);
		mygrid.setRowspan(3,2,2);
	});
</script>

</body>
</html>
